/**
*  
* @Function  归集部门统计枚举 
* @ProjectName credit-data-platform 
* @PackageName com.py.credit.entity.enums    
* @FileName AchievementCountFieldEnum.java    
* @Date 2018年5月9日上午10:50:15
* @Author Min DongXv
* @Copyright (c) 2018, 金电联行 All Rights Reserved.   
*   
*/
package com.py.credit.entity.enums;

import com.py.credit.entity.common.OptionalColumn;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * 
 * @Function 通过部门统计枚举
 *
 */
public enum AnalyseByDeptEnum {
	DEPT_NAME("deptName", "部门名称", "varchar", true, "input", false, new HashMap<String, String>(), false,
			false),
	FRXZXK("frxzxk", "法人行政许可", "long", false, "input", true, new HashMap<String, String>(), false,
			false),
	ZRRXZXK("zrrxzxk", "自然人行政许可", "long", true, "input", false, new HashMap<String, String>(), false,
			false),
	FRXZCF("frxzcf", "法人行政处罚", "long", true, "input", true, new HashMap<String, String>(), true,
			true),
	ZRRXZCF("zrrxzcf", "自然人行政处罚", "long", true, "input", false, new HashMap<String, String>(), false,
			false),

	HEJI("heji", "双公示合计", "long", true, "input", false, new HashMap<String, String>(), false,
			false),
	GSJCXX("gsjcxx", "法人库", "long", true, "input", false, new HashMap<String, String>(), false,
			false),
	HJRK("hjrk", "自然人库", "long", true, "input", false, new HashMap<String, String>(), false,
			false),
	ZJ("zj", "总计", "long", true, "input", false, new HashMap<String, String>(), false,
			false);

	private String colNameEN;
	private String colNameCN;
	private String type;
	private boolean defaultShow;
	private String widget;
	private boolean fuzzy;
	private HashMap<String, String> widgetValue;
	private boolean searchIsShow;
	private boolean advanceConditionShow;

	/**
	 * @param colNameEN
	 * @param colNameCN
	 * @param type
	 * @param defaultShow
	 * @param widget
	 * @param fuzzy
	 * @param widgetValue
	 * @param searchIsShow
	 * @param advanceConditionShow
	 */
	private AnalyseByDeptEnum(String colNameEN, String colNameCN, String type, boolean defaultShow, String widget,
                              boolean fuzzy, HashMap<String, String> widgetValue, boolean searchIsShow, boolean advanceConditionShow) {
		//英文名
		this.colNameEN = colNameEN;
		//中文名
		this.colNameCN = colNameCN;
		//数据库类型
		this.type = type;
		//默认显示
		this.defaultShow = defaultShow;
		//html类型
		this.widget = widget;
		//模糊查询
		this.fuzzy = fuzzy;
		//html类型值
		this.widgetValue = widgetValue;
		//搜索显示
		this.searchIsShow = searchIsShow;
		//高级查询
		this.advanceConditionShow = advanceConditionShow;
	}

	/**
	 * @return the colNameEN
	 */
	public String getColNameEN() {
		return colNameEN;
	}

	/**
	 * @param colNameEN
	 *            the colNameEN to set
	 */
	public void setColNameEN(String colNameEN) {
		this.colNameEN = colNameEN;
	}

	/**
	 * @return the colNameCN
	 */
	public String getColNameCN() {
		return colNameCN;
	}

	/**
	 * @param colNameCN
	 *            the colNameCN to set
	 */
	public void setColNameCN(String colNameCN) {
		this.colNameCN = colNameCN;
	}

	/**
	 * @return the type
	 */
	public String getType() {
		return type;
	}

	/**
	 * @param type
	 *            the type to set
	 */
	public void setType(String type) {
		this.type = type;
	}

	/**
	 * @return the defaultShow
	 */
	public boolean isDefaultShow() {
		return defaultShow;
	}

	/**
	 * @param defaultShow
	 *            the defaultShow to set
	 */
	public void setDefaultShow(boolean defaultShow) {
		this.defaultShow = defaultShow;
	}

	/**
	 * @return the widget
	 */
	public String getWidget() {
		return widget;
	}

	/**
	 * @param widget
	 *            the widget to set
	 */
	public void setWidget(String widget) {
		this.widget = widget;
	}

	/**
	 * @return the fuzzy
	 */
	public boolean isFuzzy() {
		return fuzzy;
	}

	/**
	 * @param fuzzy
	 *            the fuzzy to set
	 */
	public void setFuzzy(boolean fuzzy) {
		this.fuzzy = fuzzy;
	}

	/**
	 * @return the widgetValue
	 */
	public HashMap<String, String> getWidgetValue() {
		return widgetValue;
	}

	/**
	 * @param widgetValue
	 *            the widgetValue to set
	 */
	public void setWidgetValue(HashMap<String, String> widgetValue) {
		this.widgetValue = widgetValue;
	}

	/**
	 * @return the searchIsShow
	 */
	public boolean isSearchIsShow() {
		return searchIsShow;
	}

	/**
	 * @param searchIsShow
	 *            the searchIsShow to set
	 */
	public void setSearchIsShow(boolean searchIsShow) {
		this.searchIsShow = searchIsShow;
	}

	/**
	 * @return the advanceConditionShow
	 */
	public boolean isAdvanceConditionShow() {
		return advanceConditionShow;
	}

	/**
	 * @param advanceConditionShow
	 *            the advanceConditionShow to set
	 */
	public void setAdvanceConditionShow(boolean advanceConditionShow) {
		this.advanceConditionShow = advanceConditionShow;
	}

	public static List<OptionalColumn> getOptionalColumns() {

		List<OptionalColumn> OptionalColumns = new ArrayList<OptionalColumn>();
		AnalyseByDeptEnum[] values = AnalyseByDeptEnum.values();
		for (AnalyseByDeptEnum value : values) {
			OptionalColumn optionalColumn = new OptionalColumn(value.getColNameEN(), value.getColNameCN(),
					value.getType(), value.isDefaultShow(), value.getWidget(), value.isFuzzy(), value.getWidgetValue(),
					value.isSearchIsShow());
			OptionalColumns.add(optionalColumn);
		}
		return OptionalColumns;
	}

	public static List<String> getDefaultShowColumnEN() {
		List<String> columns = new ArrayList<String>();
		AnalyseByDeptEnum[] values = AnalyseByDeptEnum.values();
		for (AnalyseByDeptEnum value : values) {
			if (value.isDefaultShow()) {
				columns.add(value.getColNameEN());
			}
		}
		return columns;
	}

	public static List<OptionalColumn> getAdvancedConditionColumns() {
		List<OptionalColumn> OptionalColumns = new ArrayList<OptionalColumn>();
		AnalyseByDeptEnum[] values = AnalyseByDeptEnum.values();
		for (AnalyseByDeptEnum value : values) {
			if (value.isAdvanceConditionShow()) {
				OptionalColumn optionalColumn = new OptionalColumn(value.getColNameEN(), value.getColNameCN(),
						value.getType(), value.isDefaultShow(), value.getWidget(), value.isFuzzy(),
						value.getWidgetValue(), value.isSearchIsShow());
				OptionalColumns.add(optionalColumn);
			}
		}
		return OptionalColumns;
	}
}
